package cmo.neutech.day10.HomeWork.d3;

public class Rectangle extends Shape{
    double width;
    double height;
    public Rectangle(){};
    public Rectangle(double width,double height,String color){
        super(color);
        this.width = width;
        this.height = height;
    }

    @Override
    public double getArea() {
        return width*height;
    }
    @Override
    public double getPer() {
        return 2*(width+height);
    }
    @Override
    public void showAll(){
        System.out.println("矩形的颜色是："+getColor()+"，矩形的面积是："+getArea()+"，矩形的周长是："+getPer());
    }
}
